<?php
namespace app\index\validate;
use think\Validate;

class Order extends Validate
{
    protected $rule = [
        'number' => 'require|unique:order',
        'iphone' => '/^1[34578]\d{9}$/',
        'time'    => 'require',
        'price' => 'number',
        'qq'    => 'number',
    ];

    protected $message = [
        'number.require' => '编号必须填写',
        'number.unique' => '编号已存在',
        'iphone' => '手机号码格式不正确',
        'time'   => '时限必须填写',
        'price'  => '价格必须为数字',
        'qq'     => 'qq必须为数字',
    ];

    protected $scene = [
        'add'   => ['number','iphone','price','qq','time'],
    ];

}